home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 7: Programming / CDAT7.iso / demos / VisualAge for Java 2.0 Entry / setup / data1.cab / ide-e / IDE / cache / 3FNW0H (.txt) < prev    next >
Encoding:
Java Class File  |  1998-09-16  |  1.8 KB  |  44 lines

  1. package com.sun.java.swing.plaf.basic;
  2.  
  3. import com.sun.java.swing.AbstractAction;
  4. import java.awt.event.ActionEvent;
  5. import java.io.Serializable;
  6.  
  7. class BasicTableUI$ArrowKeyAction extends AbstractAction implements Serializable {
  8.    // $FF: synthetic field
  9.    BasicTableUI this$0;
  10.    // $FF: renamed from: dx int
  11.    protected transient int field_0;
  12.    // $FF: renamed from: dy int
  13.    protected transient int field_1;
  14.  
  15.    // $FF: synthetic method
  16.    public BasicTableUI$ArrowKeyAction(BasicTableUI this$0, int dx, int dy) {
  17.       this.this$0 = this$0;
  18.       this.field_0 = dx;
  19.       this.field_1 = dy;
  20.    }
  21.  
  22.    public boolean inRange(int index, int max) {
  23.       return index >= 0 && index < max;
  24.    }
  25.  
  26.    public void actionPerformed(ActionEvent e) {
  27.       int anchorColumn = this.this$0.table.getSelectedColumn() + this.field_0;
  28.       if (this.inRange(anchorColumn, this.this$0.table.getColumnCount())) {
  29.          int anchorRow = this.this$0.table.getSelectedRow() + this.field_1;
  30.          if (this.inRange(anchorRow, this.this$0.table.getRowCount())) {
  31.             if (this.field_0 != 0) {
  32.                BasicTableUI.access$clearSelection(this.this$0, this.this$0.table.getColumnModel().getSelectionModel());
  33.             }
  34.  
  35.             if (this.field_1 != 0) {
  36.                BasicTableUI.access$clearSelection(this.this$0, this.this$0.table.getSelectionModel());
  37.             }
  38.  
  39.             BasicTableUI.access$moveAnchor(this.this$0, anchorRow, anchorColumn);
  40.          }
  41.       }
  42.    }
  43. }
  44.